package com.sven.sharedb.range.rest;

import com.sven.sharedb.core.message.ObjectRestResponse;
import com.sven.sharedb.core.db.service.abstracts.AbstractCountCreateDateShareJob;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author sven.wang
 * @version 2022/5/25 19:32
 */
@RestController
@RequestMapping("sharedb/job")
public class ShareJobController {

    @Resource(name = "shardingOrderWzShareJob")
    private AbstractCountCreateDateShareJob iShareJobService;

    @GetMapping("/shardingJob")
    public ObjectRestResponse<String> shardingJob(@RequestParam(value = "countThreshold",required = false) Integer countThreshold,
                                                  @RequestParam(value = "tableNameDateTime",required = false) String tableNameDateTime) {
        iShareJobService.shardingJob(countThreshold,tableNameDateTime);
        return ObjectRestResponse.success("success");
    }

}
